import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView,
    // },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue'),
    // },
    {
      path: '/',
      name: '',
      component: () => import('../views/LoginView.vue'),
    },
    {
      path: '/Main',
      name: 'Main',
      component: () => import('../views/MainView.vue'),
      children: [
        {
          path: '/Receiving/Procurement',
          name: 'Procurement',
          component: () => import('../views/Receiving/Procurement.vue'),
        },
        {
          path: '/Receiving/ReturnGoods',
          name: 'ReturnGoods',
          component: () => import('../views/Receiving/ReturnGoods.vue'),
        },
        {
          path: '/Storage/ReceiptGoods',
          name: 'ReceiptGoods',
          component: () => import('../views/Storage/ReceiptGoods.vue'),
        },
        {
          path: '/Storage/PutStorage',
          name: 'PutStorage',
          component: () => import('../views/Storage/PutStorage.vue'),
        },
        {
          path: '/Outbound/Sales',
          name: 'Sales',
          component: () => import('../views/Outbound/Sales.vue'),
        },
        {
          path: '/Outbound/Record',
          name: 'Record',
          component: () => import('../views/Outbound/Record.vue'),
        },
        {
          path: '/Move/TransferManagement',
          name: 'TransferManagement',
          component: () => import('../views/Move/TransferManagement.vue'),
        },
        {
          path: '/Move/Change',
          name: 'Change',
          component: () => import('../views/Move/Change.vue'),
        },
        {
          path: '/Inventory/UsageRate',
          name: 'UsageRate',
          component: () => import('../views/Inventory/UsageRate.vue'),
        },
        {
          path: '/Inventory/InventoryLists',
          name: 'InventoryLists',
          component: () => import('../views/Inventory/InventoryLists.vue'),
        },
        {
          path: '/Inventory/LibraryList',
          name: 'LibraryList',
          component: () => import('../views/Inventory/LibraryList.vue'),
        },
        {
          path: '/Inventory/EmptyPosition',
          name: 'EmptyPosition',
          component: () => import('../views/Inventory/EmptyPosition.vue'),
        },
        {
          path: '/Inventory/InStock',
          name: 'InStock',
          component: () => import('../views/Inventory/InStock.vue'),
        },
        {
          path: '/Inventory/RunningWater',
          name: 'RunningWater',
          component: () => import('../views/Inventory/RunningWater.vue'),
        },
        {
          path: '/Material/MaterialTypes',
          name: 'MaterialTypes',
          component: () => import('../views/Material/MaterialTypes.vue'),
        },
        {
          path: '/Material/Management',
          name: 'Management',
          component: () => import('../views/Material/Management.vue'),
        },
        {
          path: '/Queries/QueriesNlog',
          name: 'QueriesNlog',
          component: () => import('../views/Queries/QueriesNlog.vue'),
        },
        {
          path: '/Basic/DictionaryTypes',
          name: 'DictionaryTypes',
          component: () => import('../views/Basic/DictionaryTypes.vue'),
        },
        {
          path: '/Basic/DictionaryItem',
          name: 'DictionaryItem',
          component: () => import('../views/Basic/DictionaryItem.vue'),
        },
        {
          path: '/Basic/Supplier',
          name: 'Supplier',
          component: () => import('../views/Basic/Supplier.vue'),
        },
        {
          path: '/Basic/Warehouse',
          name: '/Warehouse',
          component: () => import('../views/Basic/Warehouse.vue'),
        },
        {
          path: '/Basic/ReservoirArea',
          name: 'ReservoirArea',
          component: () => import('../views/Basic/ReservoirArea.vue'),
        },
        {
          path: '/Basic/LocationWarehouse',
          name: 'LocationWarehouse',
          component: () => import('../views/Basic/LocationWarehouse.vue'),
        },
        {
          path: '/Basic/Pallet',
          name: 'Pallet',
          component: () => import('../views/Basic/Pallet.vue'),
        },
        {
          path: '/RBAC/Menu',
          name: 'Menu',
          component: () => import('../views/RBAC/Menu.vue'),
        },
        {
          path: '/RBAC/Role',
          name: 'Role',
          component: () => import('../views/RBAC/Role.vue'),
        },
        {
          path: '/RBAC/User',
          name: 'User',
          component: () => import('../views/RBAC/User.vue'),
        },
        {
          path: '/RBAC/Button',
          name: 'Button',
          component: () => import('../views/RBAC/Button.vue'),
        },
        {
          path: '/Workbench/NodeManagement',
          name: 'NodeManagement',
          component: () => import('../views/Workbench/NodeManagement.vue'),
        },
        {
          path: '/Workbench/AgentCharge',
          name: 'AgentCharge',
          component: () => import('../views/Workbench/AgentCharge.vue'),
        },
        {
          path: '/Workbench/Done',
          name: 'Done',
          component: () => import('../views/Workbench/Done.vue'),
        },
      ]
    },
  ],
})

export default router
